<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
#div1{width: 100px;height: 100px;background: red;position: absolute;left: 0px;top: 60px;}
</style>
<script>
window.onload = function(){
   var oInput = document.getElementById('btn');
   var oDiv =  document.getElementById('div1');

   var timer = null;
   var iSpeed = 0;

   oInput.onclick = function(){
      startMove();
   }

   function startMove(){
      clearInterval(timer);
      timer = setInterval(function(){
          var iSpeed = 10;
          oDiv.style.left = oDiv.offsetLeft + iSpeed + 'px';
      },30);
   }
}

</script>
<title>运动</title>
</head>
<body>
    <input type="button" value="运动" id="btn" />
    <div id="div1"></div>
</body>
</html>